package org.giovanolli.mumi.entities;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * The Class Prepaid.
 */
@Entity
@Table(name = "prepaid")
public class Prepaid extends IdentificableEntity {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 702944833372324110L;

	/** The name. */
	@Column(name = "name", unique = true)
	private String name;

	/** The patient prepaids. */
	@OneToMany(cascade = CascadeType.ALL)
	@JoinColumn(name = "prepaid_id")
	private List<PatientPrepaid> patientPrepaids;

	/**
	 * Gets the name.
	 * 
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * Sets the name.
	 * 
	 * @param name
	 *            the new name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Gets the patient prepaids.
	 * 
	 * @return the patient prepaids
	 */
	public List<PatientPrepaid> getPatientPrepaids() {
		return patientPrepaids;
	}

	/**
	 * Sets the patient prepaids.
	 * 
	 * @param patientPrepaids
	 *            the new patient prepaids
	 */
	public void setPatientPrepaids(List<PatientPrepaid> patientPrepaids) {
		this.patientPrepaids = patientPrepaids;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.osoftware.mumi.dao.model.BaseObject#toString()
	 */
	@Override
	public String toString() {
		return "Prepaid [name=" + name + ", toString()=" + super.toString() + "]";
	}

}
